home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / nt / lkbackup.zip / tailor.h < prev    next >
C/C++ Source or Header  |  1993-09-27  |  8KB  |  343 lines

  1. /* tailor.h -- target dependent definitions
  2.  * Copyright (C) 1992-1993 Jean-loup Gailly.
  3.  * This is free software; you can redistribute it and/or modify it under the
  4.  * terms of the GNU General Public License, see the file COPYING.
  5.  */
  6.  
  7. /* The target dependent definitions should be defined here only.
  8.  * The target dependent functions should be defined in tailor.c.
  9.  */
  10.  
  11. /* $Id: tailor.h,v 1.25 1993/09/28 04:29:59 ESullivan Exp ESullivan $ */
  12.  
  13. #if defined(__MSDOS__) && !defined(MSDOS)
  14. #  define MSDOS
  15. #endif
  16.  
  17. #if defined(__OS2__) && !defined(OS2)
  18. #  define OS2
  19. #endif
  20.  
  21. #if defined(OS2) && defined(MSDOS) /* MS C under OS/2 */
  22. #  undef MSDOS
  23. #endif
  24.  
  25. #ifdef MSDOS
  26. #  ifdef __GNUC__
  27.      /* DJGPP version 1.09+ on MS-DOS.
  28.       * The DJGPP 1.09 stat() function must be upgraded before gzip will
  29.       * fully work.
  30.       * No need for DIRENT, since <unistd.h> defines POSIX_SOURCE which
  31.       * implies DIRENT.
  32.       */
  33. #    define near
  34. #  else
  35. #    define MAXSEG_64K
  36. #    ifdef __TURBOC__
  37. #      define NO_OFF_T
  38. #      ifdef __BORLANDC__
  39. #        define DIRENT
  40. #      else
  41. #        define NO_UTIME
  42. #      endif
  43. #    else /* MSC */
  44. #      define HAVE_SYS_UTIME_H
  45. #      define NO_UTIME_H
  46. #    endif
  47. #  endif
  48. #  define PATH_SEP2 '\\'
  49. #  define PATH_SEP3 ':'
  50. #  define MAX_PATH_LEN  128
  51. #  define NO_MULTIPLE_DOTS
  52. #  define MAX_EXT_CHARS 3
  53. #  define Z_SUFFIX "z"
  54. #  define NO_CHOWN
  55. #  define PROTO
  56. #  define STDC_HEADERS
  57. #  define NO_SIZE_CHECK
  58. #  define casemap(c) tolow(c) /* Force file names to lower case */
  59. #  include <io.h>
  60. #  define OS_CODE  0x00
  61. #  define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
  62. #  if !defined(NO_ASM) && !defined(ASMV)
  63. #    define ASMV
  64. #  endif
  65. #else
  66. #  define near
  67. #endif
  68.  
  69. #ifdef OS2
  70. #  define PATH_SEP2 '\\'
  71. #  define PATH_SEP3 ':'
  72. #  define MAX_PATH_LEN  260
  73. #  ifdef OS2FAT
  74. #    define NO_MULTIPLE_DOTS
  75. #    define MAX_EXT_CHARS 3
  76. #    define Z_SUFFIX "z"
  77. #    define casemap(c) tolow(c)
  78. #  endif
  79. #  define NO_CHOWN
  80. #  define PROTO
  81. #  define STDC_HEADERS
  82. #  include <io.h>
  83. #  define OS_CODE  0x06
  84. #  define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
  85. #  ifdef _MSC_VER
  86. #    define HAVE_SYS_UTIME_H
  87. #    define NO_UTIME_H
  88. #    define MAXSEG_64K
  89. #    undef near
  90. #    define near _near
  91. #  endif
  92. #  ifdef __EMX__
  93. #    define HAVE_SYS_UTIME_H
  94. #    define NO_UTIME_H
  95. #    define DIRENT
  96. #    define EXPAND(argc,argv) \
  97.        {_response(&argc, &argv); _wildcard(&argc, &argv);}
  98. #  endif
  99. #  ifdef __BORLANDC__
  100. #    define DIRENT
  101. #  endif
  102. #  ifdef __ZTC__
  103. #    define NO_DIR
  104. #    define NO_UTIME_H
  105. #    include <dos.h>
  106. #    define EXPAND(argc,argv) \
  107.        {response_expand(&argc, &argv);}
  108. #  endif
  109. #endif
  110.  
  111. #ifdef WIN32 /* Windows NT */
  112. #  define HAVE_SYS_UTIME_H
  113. #  define NO_UTIME_H
  114. #  define PATH_SEP2 '\\'
  115. #  define PATH_SEP3 ':'
  116. #  define MAX_PATH_LEN  260
  117. #  define NO_CHOWN
  118. #  define PROTO
  119. #  define STDC_HEADERS
  120. #    define O_RDONLY    _O_RDONLY
  121. #    define O_WRONLY    _O_WRONLY
  122. #    define O_RDWR        _O_RDWR
  123. #    define O_APPEND    _O_APPEND
  124. #    define O_CREAT     _O_CREAT
  125. #    define O_TRUNC     _O_TRUNC
  126. #    define O_EXCL        _O_EXCL
  127. #    define O_TEXT        _O_TEXT
  128. #    define O_BINARY    _O_BINARY
  129. #    define O_RAW        _O_BINARY
  130. #    define O_TEMPORARY    _O_TEMPORARY
  131. #    define O_NOINHERIT    _O_NOINHERIT
  132. #    define O_SEQUENTIAL    _O_SEQUENTIAL
  133. #    define O_RANDOM    _O_RANDOM
  134. #  define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
  135. #  include <io.h>
  136. #  include <malloc.h>
  137. #  ifdef NTFAT
  138. #    define NO_MULTIPLE_DOTS
  139. #    define MAX_EXT_CHARS 3
  140. #    define Z_SUFFIX "z"
  141. #    define casemap(c) tolow(c) /* Force file names to lower case */
  142. #  endif
  143. #  define OS_CODE  0x0b
  144. #endif
  145.  
  146. #ifdef MSDOS
  147. #  ifdef __TURBOC__
  148. #    include <alloc.h>
  149. #    define DYN_ALLOC
  150.      /* Turbo C 2.0 does not accept static allocations of large arrays */
  151.      void * fcalloc (unsigned items, unsigned size);
  152.      void fcfree (void *ptr);
  153. #  else /* MSC */
  154. #    include <malloc.h>
  155. #    define fcalloc(nitems,itemsize) halloc((long)(nitems),(itemsize))
  156. #    define fcfree(ptr) hfree(ptr)
  157. #  endif
  158. #else
  159. #  ifdef MAXSEG_64K
  160. #    define fcalloc(items,size) calloc((items),(size))
  161. #  else
  162. #    define fcalloc(items,size) malloc((size_t)(items)*(size_t)(size))
  163. #  endif
  164. #  define fcfree(ptr) free(ptr)
  165. #endif
  166.  
  167. #if defined(VAXC) || defined(VMS)
  168. #  define PATH_SEP ']'
  169. #  define PATH_SEP2 ':'
  170. #  define SUFFIX_SEP ';'
  171. #  define NO_MULTIPLE_DOTS
  172. #  define Z_SUFFIX "-gz"
  173. #  define RECORD_IO 1
  174. #  define casemap(c) tolow(c)
  175. #  define OS_CODE  0x02
  176. #  define OPTIONS_VAR "GZIP_OPT"
  177. #  define STDC_HEADERS
  178. #  define NO_UTIME
  179. #  define EXPAND(argc,argv) vms_expand_args(&argc,&argv);
  180. #  include <file.h>
  181. #  define unlink delete
  182. #  ifdef VAXC
  183. #    define NO_FCNTL_H
  184. #    include <unixio.h>
  185. #  endif
  186. #endif
  187.  
  188. #ifdef AMIGA
  189. #  define PATH_SEP2 ':'
  190. #  define STDC_HEADERS
  191. #  define OS_CODE  0x01
  192. #  define ASMV
  193. #  ifdef __GNUC__
  194. #    define DIRENT
  195. #    define HAVE_UNISTD_H
  196. #  else /* SASC */
  197. #    define NO_STDIN_FSTAT
  198. #    define SYSDIR
  199. #    define NO_SYMLINK
  200. #    define NO_CHOWN
  201. #    define NO_FCNTL_H
  202. #    include <fcntl.h> /* for read() and write() */
  203. #    define direct dirent
  204.      extern void _expand_args(int *argc, char ***argv);
  205. #    define EXPAND(argc,argv) _expand_args(&argc,&argv);
  206. #    undef  O_BINARY /* disable useless --ascii option */
  207. #  endif
  208. #endif
  209.  
  210. #if defined(ATARI) || defined(atarist)
  211. #  ifndef STDC_HEADERS
  212. #    define STDC_HEADERS
  213. #    define HAVE_UNISTD_H
  214. #    define DIRENT
  215. #  endif
  216. #  define ASMV
  217. #  define OS_CODE  0x05
  218. #  ifdef TOSFS
  219. #    define PATH_SEP2 '\\'
  220. #    define PATH_SEP3 ':'
  221. #    define MAX_PATH_LEN  128
  222. #    define NO_MULTIPLE_DOTS
  223. #    define MAX_EXT_CHARS 3
  224. #    define Z_SUFFIX "z"
  225. #    define NO_CHOWN
  226. #    define casemap(c) tolow(c) /* Force file names to lower case */
  227. #    define NO_SYMLINK
  228. #  endif
  229. #endif
  230.  
  231. #ifdef MACOS
  232. #  define PATH_SEP ':'
  233. #  define DYN_ALLOC
  234. #  define PROTO
  235. #  define NO_STDIN_FSTAT
  236. #  define NO_CHOWN
  237. #  define NO_UTIME
  238. #  define chmod(file, mode) (0)
  239. #  define OPEN(name, flags, mode) open(name, flags)
  240. #  define OS_CODE  0x07
  241. #  ifdef MPW
  242. #    define isatty(fd) ((fd) <= 2)
  243. #  endif
  244. #endif
  245.  
  246. #ifdef __50SERIES /* Prime/PRIMOS */
  247. #  define PATH_SEP '>'
  248. #  define STDC_HEADERS
  249. #  define NO_MEMORY_H
  250. #  define NO_UTIME_H
  251. #  define NO_UTIME
  252. #  define NO_CHOWN 
  253. #  define NO_STDIN_FSTAT 
  254. #  define NO_SIZE_CHECK 
  255. #  define NO_SYMLINK
  256. #  define RECORD_IO  1
  257. #  define casemap(c)  tolow(c) /* Force file names to lower case */
  258. #  define put_char(c) put_byte((c) & 0x7F)
  259. #  define get_char(c) ascii2pascii(get_byte())
  260. #  define OS_CODE  0x0F    /* temporary, subject to change */
  261. #  ifdef SIGTERM
  262. #    undef SIGTERM         /* We don't want a signal handler for SIGTERM */
  263. #  endif
  264. #endif
  265.  
  266. #if defined(pyr) && !defined(NOMEMCPY) /* Pyramid */
  267. #  define NOMEMCPY /* problem with overlapping copies */
  268. #endif
  269.  
  270. #ifdef TOPS20
  271. #  define OS_CODE  0x0a
  272. #endif
  273.  
  274. #ifndef unix
  275. #  define NO_ST_INO /* don't rely on inode numbers */
  276. #endif
  277.  
  278.  
  279.     /* Common defaults */
  280.  
  281. #ifndef OS_CODE
  282. #  define OS_CODE  0x03  /* assume Unix */
  283. #endif
  284.  
  285. #ifndef PATH_SEP
  286. #  define PATH_SEP '/'
  287. #endif
  288.  
  289. #ifndef casemap
  290. #  define casemap(c) (c)
  291. #endif
  292.  
  293. #ifndef OPTIONS_VAR
  294. #  define OPTIONS_VAR "GZIP"
  295. #endif
  296.  
  297. #ifndef Z_SUFFIX
  298. #  define Z_SUFFIX ".gz"
  299. #endif
  300.  
  301. #ifdef MAX_EXT_CHARS
  302. #  define MAX_SUFFIX  MAX_EXT_CHARS
  303. #else
  304. #  define MAX_SUFFIX  30
  305. #endif
  306.  
  307. #ifndef MAKE_LEGAL_NAME
  308. #  ifdef NO_MULTIPLE_DOTS
  309. #    define MAKE_LEGAL_NAME(name)   make_simple_name(name)
  310. #  else
  311. #    define MAKE_LEGAL_NAME(name)
  312. #  endif
  313. #endif
  314.  
  315. #ifndef MIN_PART
  316. #  define MIN_PART 3
  317.    /* keep at least MIN_PART chars between dots in a file name. */
  318. #endif
  319.  
  320. #ifndef EXPAND
  321. #  define EXPAND(argc,argv)
  322. #endif
  323.  
  324. #ifndef RECORD_IO
  325. #  define RECORD_IO 0
  326. #endif
  327.  
  328. #ifndef SET_BINARY_MODE
  329. #  define SET_BINARY_MODE(fd)
  330. #endif
  331.  
  332. #ifndef OPEN
  333. #  define OPEN(name, flags, mode) open(name, flags, mode)
  334. #endif
  335.  
  336. #ifndef get_char
  337. #  define get_char() get_byte()
  338. #endif
  339.  
  340. #ifndef put_char
  341. #  define put_char(c) put_byte(c)
  342. #endif
  343.